﻿// Decompiled with JetBrains decompiler
// Type: Microsoft.InfoCards.AccessibilityApplicationManager
// Assembly: infocard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// MVID: 8E14765A-6610-409A-BA36-099A0642905D
// Assembly location: E:\git\ALLIDA\windll\infocard.exe

using System;
using System.Security.Principal;

namespace Microsoft.InfoCards
{
  internal class AccessibilityApplicationManager
  {
    private const int WindowsVistaMajorVersion = 6;
    private IAccessibilityHelper m_helper;

    public AccessibilityApplicationManager()
    {
      bool fTabletPC = 0 != NativeMethods.GetSystemMetrics(86);
      if (Environment.OSVersion.Version.Major < 6)
        this.m_helper = (IAccessibilityHelper) new AccessibilityHelperForXpWin2k3(fTabletPC);
      else
        this.m_helper = (IAccessibilityHelper) new AccessibilityHelperForVista(fTabletPC);
    }

    public void Stop()
    {
      this.m_helper.Stop();
    }

    public void RestartOnInfoCardDesktop(
      uint userATApplicationFlags,
      SafeNativeHandle hTrustedUserToken,
      ref string trustedUserSid,
      string infocardDesktop,
      int userSessionId,
      uint userProcessId,
      WindowsIdentity userIdentity)
    {
      this.m_helper.RestartOnInfoCardDesktop(userATApplicationFlags, hTrustedUserToken, ref trustedUserSid, infocardDesktop, userSessionId, userProcessId, userIdentity);
    }

    public bool RestartOnUsersDesktop(
      uint userProcessId,
      string userDesktop,
      WindowsIdentity userIdentity)
    {
      return this.m_helper.RestartOnUsersDesktop(userProcessId, userDesktop, userIdentity);
    }
  }
}
